* 1) Revised versions:

*Contemporaneous
eststo clear
use tempfirst_nonmfg, clear
global depvar = "theil"
global depvar_d1 = "theil_d1"
global nbnc8iso2 " "
global nbnc8iso2_d1 " "
global clustvar "iso2_d"
*
gen cond = abs((nbnc8iso2isic-L.nbnc8iso2isic)/L.nbnc8iso2isic)
gen byte cond5 = cond==0
*
eststo : reghdfe $depvar ltradeshock3  lgdpcapshock3 $nbnc8iso2  yd* ,  cluster($clustvar) a(firmiso)
eststo : reghdfe $depvar ltradeshock3i lgdpcapshock3 $nbnc8iso2  yd* ,  cluster($clustvar) a(firmiso)
*
eststo : reg $depvar_d1  ltradeshock6  lgdpcapshock6 $nbnc8iso2_d1  yd* , robust cluster($clustvar)
eststo : reg $depvar_d1  ltradeshock6i lgdpcapshock6 $nbnc8iso2_d1  yd* , robust cluster($clustvar)
*
eststo : reghdfe $depvar_d1  ltradeshock6  lgdpcapshock6 $nbnc8iso2_d1 yd* ,  cluster($clustvar) a(firmiso)
eststo : reghdfe $depvar_d1  ltradeshock6i lgdpcapshock6 $nbnc8iso2_d1 yd* ,  cluster($clustvar) a(firmiso)
*
log using $DIRLOG/Replication/tab-firstststagetrue_rev_nonmfg.txt, text replace
set linesize 250
esttab , keep(ltradeshock* )  b(%4.3f) se(%4.3f) r2 starlevels({$^c$} 0.1 {$^b$} 0.05 {$^a$} 0.01)  tex  title() label
esttab , keep(ltradeshock* ) compress r2 starlevels(c 0.1 b 0.05 a 0.01)  b(%4.3f) se(%4.3f)
*output the results in a tex file directly inputable in the text
esttab using $DIRLOG/Replication/tab-firstststagetrue_rev_input_nonmfg.tex, b(%4.3f) se(%4.3f)  starlevels({$^c$} 0.1 {$^b$} 0.05 {$^a$} 0.01)    ///
nocons drop(yd* _cons lgdpcapshock* )  label tex substitute(\_ _) fragment replace nodepvars nonumbers nomtitles nogaps nolines eqlabels(none)
eststo clear
log close

